package com.czd.support.service;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.model.Investor;

/**
 * 
 * @Description  投资人业务类
 * @Author caoren
 * @Date    2015年5月31日 下午2:39:22
 * @Version v1.0
 */
@Service
public class InvestorService extends BaseService<Investor>{
	public Paginate queryForPage(Investor investor , String kw) {
		investor.setWhere(" 1=1");
        if(StringUtils.isNotBlank(kw)){
        	investor.setWhere(investor.getWhere() + " and (investorRealname like '"+kw+"%' or investorPhone like '"+kw+"%')");
        }
		return this.queryForPaginate(sqlId("queryForPage"), investor);
	}
	
	public Investor findById(int id){
		return this.selectOneById(sqlId("findById"), id);
	}
}
